package robocup.component.infotypes;

import robocup.component.ControllerNumbers.REFEREE_MESSAGE;

/**
 * This info represents the announcement of an event recognized by the referee
 * (e.g. foul, goal, etc.).
 * 
 */
public class RefereeInfo
    extends AuralInfo {

  /**
   * The referee message (event), which is received.
   */
  private REFEREE_MESSAGE infoType = REFEREE_MESSAGE.UNKNOWN;

  /**
   * A referee-message (such as foul or offside)
   * 
   * @param iCycle -
   *          the time, when it was received
   * @param type -
   *          the type of the message
   */
  public RefereeInfo(
      final int iCycle,
      final REFEREE_MESSAGE type) {

    super(iCycle);
    this.infoType = type;
  }

  /**
   * Returns the infoType transmitted through this info message
   */
  public REFEREE_MESSAGE getRefereeMessageType() {

    return this.infoType;
  }

  /**
   * @return Returns a debug-string for that info-object.
   */
  @Override
  public String toString() {

    String s = "REFEREE_MESSAGE_";
    s += this.infoType.toString();

    return s;
  }

  /**
   * Sets a new referee-message to that info-object.
   * 
   * @param infoType
   */
  public void setRefereeMessageType(final REFEREE_MESSAGE infoType) {

    this.infoType = infoType;
  }
}
